You are here: About the advanced features > VBScript examples > Executing remote script functions

Executing remote script functions

The Global Collaboration Framework provides a remote command feature that can be used to run custom VBScript functions in a remote vault. This can be useful to set different property values for transferred documents than the source documents, for example.

Note    Use caution with remote commands because you cannot anticipate when they will be executed, as opposed to a remote call.

To invoke a command remotely, you add it to the GCFCommands table in the local vault, which acts as a queue for the remote vault. The GCF reads the data from this table, generates a text file, and transfers it to the remote vault for execution as described in Understanding remote commands.

To queue a command for remote execution:

  1. Add a record to the GCFCommands table from your Visual Basic or VBScript customization. The record should contain the information described in GCFCommands table.

For example, if the following function is defined in the destination vault:

Function SetValue1(v1, v2)
    Document.MyProperty = "SetValue1: " & v1 & " " & v2
End Function

Then the following statement executed in the local vault will schedule execution of the function SetValue1 in the remote vault:

Vault.Table ("GCFCommands").AddValues _
  Array ("GlobalID", "DestinationShare", "Pending", "Command", "DocName") _
  Array (Document.GlobalID, "OtherVault", True, _ "SCRIPT::SetValue1 ""String with space"" 1234", Document.Filename)

After the command executes, the property MyProperty in the remote vault is set to the following value:

SetValue1: String with space 1234

Related concepts

Centralizing sequence number generation

Understanding table data replication

Understanding remote commands

Related tasks

Transferring ownership upon release

Calculating import notification messages

UpdateTable example

Calculating document names

Requesting a document name

Handling hub vault unavailability

Enlisting all sites for new documents

Customizing site delistment

Related information

GCFCommands table


www.bluecieloecm.com